/**
 * 
 */
package com.lorizz.picpub.web.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.lorizz.upm.np.AlbumNP;

/**
 * @author wind hong
 *
 */
@Controller
@RequestMapping("/i")
public interface ImageController {
    
    @Transactional
    @RequestMapping(value = "/albums", method = RequestMethod.GET)
    String albums(HttpSession session, Model model);
    
    @Transactional
    @RequestMapping(value = "/albums/{userProfileId}", method = RequestMethod.GET)
    String albums(@PathVariable("userProfileId") long userProfileId, Model model);
    
    @RequestMapping(value = "/album", method = RequestMethod.GET)
    String album(Model model);
    
    @Transactional
    @RequestMapping(value = "/album", method = RequestMethod.POST)
    String album(@ModelAttribute("album") AlbumNP album, BindingResult result, HttpSession session, Model model);
    
    @Transactional
    @RequestMapping(value = "/v/{albumId}-{pageSize}-{page}", method = RequestMethod.GET)
    String images(@PathVariable("albumId") long albumId, @PathVariable("pageSize") int pageSize, @PathVariable("page") int page, Model model);
    
    @Transactional
    @RequestMapping(value = "/v/{albumId}/{imageId}", method = RequestMethod.GET)
    String images(@PathVariable("albumId") long albumId, @PathVariable("imageId") long imageId, Model model);
    
    @Transactional
    @RequestMapping(value = "/{imageId}", method = RequestMethod.GET)
    String image(@PathVariable("imageId") long imageId, Model model);
    
}
